package com.lagou.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lagou.mapper.ArticleMapper;
import com.lagou.pojo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;


    @Override
    public PageInfo<Article> mylist(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);

        List<Article> article = articleMapper.selectArticle();
        PageInfo<Article> articlePageInfo = new PageInfo<>(article);

        return articlePageInfo;
    }
}
